FROM node AS build
WORKDIR /app
COPY  ./ .
RUN npm config set registry https://registry.npmmirror.com
RUN npm install
RUN npm run build
From nginx AS prod
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY --from=build  /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
